package statistics;

import java.util.Random;

/**
 * This is an abstract class, called ContinuousDistribution. It represents
 * a continuous distribution.
 */

public abstract class ContinuousDistribution extends Distribution {

   /**
    * Returns P(X <= x)
    * @param x
    */

   public abstract double probabilityFunction(double x);
   
   /**
    * Fits a continuous distribution to the specified mean and standard deviation.
    * @param mean the mean
    * @param deviation the standard deviation
    * @return the fit DiscreteDistribution.
    */
    
   public static ContinuousDistribution fit(double mean, double deviation) {
     return fit(mean, deviation, new Random());
   }

   /**
    * Fits a continuous distribution to the specified mean and standard deviation.
    * @param mean the mean
    * @param deviation the standard deviation
    * @param random the random number generator
    * @return the fit DiscreteDistribution.
    */

   public static ContinuousDistribution fit(double mean, double deviation, Random random) {
     // not YET implemented!!!!
     return new NormalDistribution(mean, deviation, random);
   }
}
